<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>


        class Person {
            constructor(name, age) {
                this.type = '人';
                this.name = name;
                this.age = age;
            }

            say() {
                console.log('hi');
            }
        }


        class Student extends Person {
            constructor(name, age, score, grade) {
                super(name, age);    // 在constructor内部必须调用super函数向父类传参    
                this.score = score;
                this.grage = grade;
            }

            speak() {
                console.log('hello');
            }
        }


        const s = new Student('cc', 10, 100, '3');
        console.log(s);

    </script>

</body>

</html>